package LoginPackage;


import org.testng.annotations.Test;

import PagePackage.MyPageFactory;
import PagePackage.internalPageClass;
import PagePackage.loginPageClass;
import PagePackage.teamsPage;
import PagePackage.userRolePageClass;




public class NewTeamClass extends TestBaseClass{
	


	@Test (priority=0)	
  public void AdminCreatesNewTeamBasketball() {
		 
		goToMainPage();
		checkPage();
		 MyPageFactory.getPage(driver, loginPageClass.class).loginAs("victoria@krossover.com", "webmaster");
		
		 MyPageFactory.getPage(driver, userRolePageClass.class).clickTeamTab()
		 .clickAddNewTeamButton()
		 .chooseTeamSport("Basketball")
		 .chooseLeagueSport("Male Basketball League")
		 .chooseSchoolSport("Basketball University")
		 .addTeamName("Selenium Basketball University Team")
		 .saveTeam()
		 .findTeambyName("Selenium Basketball University Team")
		 .scrollAndClickTeam( 0, 0, "//*[text()='Selenium Basketball University Team']");
		 driver.get("https://www-dev.krossover.com/intelligence-qa/teams");
		 MyPageFactory.getPage(driver, internalPageClass.class).logout();
		 
		
	
		 }
	
	@Test (priority=1)	
	  public void AdminCreatesNewTeamFootball() {
		 
	         goToMainPage();
	         checkPage();
			 MyPageFactory.getPage(driver, loginPageClass.class).loginAs("victoria@krossover.com", "webmaster");
			
			 MyPageFactory.getPage(driver, userRolePageClass.class).clickTeamTab()
			 .clickAddNewTeamButton()
			 .chooseTeamSport("Football") 
			 .chooseLeagueSport("Football League")
			 .chooseSchoolSport("Football High School")
			 .addTeamName("Selenium Football High School Team")
			 .saveTeam()
			 .findTeambyName("Selenium Football High School Team")
			 
			
			 .scrollAndClickTeam( 0, 0, "//*[text()='Selenium Football High School Team']");
			 driver.get("https://www-dev.krossover.com/intelligence-qa/teams");
			 MyPageFactory.getPage(driver, internalPageClass.class).logout();
			
		
			 }
	
	@Test (priority=2)	
	
	  public void AdminCreatesNewTeamLacrosse() {
		
		     goToMainPage();
		     checkPage();
			 MyPageFactory.getPage(driver, loginPageClass.class).loginAs("victoria@krossover.com", "webmaster");
			
			 MyPageFactory.getPage(driver, userRolePageClass.class).clickTeamTab()
			 .clickAddNewTeamButton()
			 .chooseTeamSport("Lacrosse")
			 .chooseLeagueSport("Lacrosse League")
			 .chooseSchoolSport("Lacrosse Other")
			 .addTeamName("Selenium Lacrosse Other Team")
			 .saveTeam()
			 .findTeambyName("Selenium Lacrosse Other Team")
			 .scrollAndClickTeam( 0, 0, "//*[text()='Selenium Lacrosse Other Team']");
			 driver.get("https://www-dev.krossover.com/intelligence-qa/teams");
			 MyPageFactory.getPage(driver, internalPageClass.class).logout();
			
		
			 }
	
	
	@Test (priority=3)
	  public void SACreatesNewTeamBasketball() {
			 
			goToMainPage(); 
			checkPage();
			 MyPageFactory.getPage(driver, loginPageClass.class).loginAs("victoria@victoria.com", "webmaster");
			
			 MyPageFactory.getPage(driver, userRolePageClass.class).clickTeamTab()
			 .clickAddNewTeamButton()
			 .chooseTeamSport("Basketball")
			 .chooseLeagueSport("Male Basketball League")
			 .chooseSchoolSport("Basketball University")
			 .addTeamName("Selenium Basketball University Team SA")
			 .saveTeam()
			 .findTeambyName("Selenium Basketball University Team SA")
			
			 .scrollAndClickTeam( 0, 0, "//*[text()='Selenium Basketball University Team SA']");
			 driver.get("https://www-dev.krossover.com/intelligence-qa/teams");
			 MyPageFactory.getPage(driver, internalPageClass.class).logout();
			
		
			 }
	
	
	@Test (priority=4)	
		  public void SACreatesNewTeamFootball() {
			 
		         goToMainPage();
		         checkPage();
				 MyPageFactory.getPage(driver, loginPageClass.class).loginAs("victoria@victoria.com", "webmaster");
				
				 MyPageFactory.getPage(driver, userRolePageClass.class).clickTeamTab()
				 .clickAddNewTeamButton()
				 .chooseTeamSport("Football") 
				 .chooseLeagueSport("Football League")
				 .chooseSchoolSport("Football High School")
				 .addTeamName("Selenium Football High School Team SA")
				 .saveTeam()
				 .findTeambyName("Selenium Football High School Team SA")
				 .scrollAndClickTeam( 0, 0, "//*[text()='Selenium Football High School Team SA']");
				 driver.get("https://www-dev.krossover.com/intelligence-qa/teams");
				 MyPageFactory.getPage(driver, internalPageClass.class).logout();
				
			
				 }
	
	
	@Test (priority=5)	
		  public void SACreatesNewTeamLacrosse() {
			
			     goToMainPage();
			     checkPage();
				 MyPageFactory.getPage(driver, loginPageClass.class).loginAs("victoria@victoria.com", "webmaster");
				
				 MyPageFactory.getPage(driver, userRolePageClass.class).clickTeamTab()
				 .clickAddNewTeamButton()
				 .chooseTeamSport("Lacrosse")
				 .chooseLeagueSport("Lacrosse League")
				 .chooseSchoolSport("Lacrosse Other")
				 .addTeamName("Selenium Lacrosse Other Team SA")
				 .saveTeam()
				 .findTeambyName("Selenium Lacrosse Other Team SA")
				 .scrollAndClickTeam( 0, 0, "//*[text()='Selenium Lacrosse Other Team SA']");
				 
				 driver.get("https://www-dev.krossover.com/intelligence-qa/teams");
				 MyPageFactory.getPage(driver, internalPageClass.class).logout();
			
				 }
	
	@Test (priority=6)	
		  public void AdminCancelsNewUserCreation() {
				 
				goToMainPage(); 
				checkPage();
				 MyPageFactory.getPage(driver, loginPageClass.class).loginAs("victoria@krossover.com", "webmaster");
				
				 MyPageFactory.getPage(driver, userRolePageClass.class).clickTeamTab()
				 .clickAddNewTeamButton()
				 .chooseTeamSport("Basketball")
				 .chooseLeagueSport("Male Basketball League")
				 .chooseSchoolSport("Basketball University")
				 .addTeamName("Selenium Basketball University Team Cancel")
				 .cancelTeam()
				 .findTeambyName("Selenium Basketball University Team Cancel");
				
				 MyPageFactory.getPage(driver, teamsPage.class).scrollAndClickTeam2(0, 0, "//*[text()='Selenium Basketball University Team Cancel']");
				 driver.get("https://www-dev.krossover.com/intelligence-qa/teams");
				 MyPageFactory.getPage(driver, internalPageClass.class).logout();
				 
				
			
				 }
				 
	@Test (priority=7)		
		  public void SACancelsNewUserCreation() {
				 
				goToMainPage();
				checkPage();
				 MyPageFactory.getPage(driver, loginPageClass.class).loginAs("victoria@victoria.com", "webmaster");
				
				 MyPageFactory.getPage(driver, userRolePageClass.class).clickTeamTab()
				 .clickAddNewTeamButton()
				 .chooseTeamSport("Basketball")
				 .chooseLeagueSport("Male Basketball League")
				 .chooseSchoolSport("Basketball University")
				 .addTeamName("Selenium Basketball University Team Cancel SA")
				 .cancelTeam()
				 .findTeambyName("Selenium Basketball University Team Cancel SA");
				
				 MyPageFactory.getPage(driver, teamsPage.class).scrollAndClickTeam2(0, 0, "//*[text()='Selenium Basketball University Team Cancel SA']");
				 driver.get("https://www-dev.krossover.com/intelligence-qa/teams");
				 MyPageFactory.getPage(driver, internalPageClass.class).logout();
				 
				
			
				 }
	
	

	
}


	


